// run: $exec < input
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>

int const maxn = 200;
std::pair<int, int> from[maxn][10];
bool f[maxn][10];
std::string s;
int n;

void print(int pos)
{
	std::string ts;
	std::pair<int, int> now(pos, 0);
	for (; now.first; now = from[now.first][now.second]) {
		ts += s[now.first - 1];
	}
	while (ts.size() > 1 && ts[0] == '0') ts.erase(ts.end() - 1);
	std::reverse(ts.begin(), ts.end());
	std::cout << ts << "\n";
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> s;
	n = s.size();
	f[0][0] = true;
	for (int i = 1; i <= n; i++) {
		int now = s[i - 1] - '0';
		for (int j = i - 1; j >= 0; j--) {
			for (int k = 0; k < 8; k++) {
				if (f[j][k]) {
					int t = (k * 2 + now) % 8;
					f[i][t] = true;
					from[i][t] = std::make_pair(j, k);
				}
			}
		}
	}
	int pos = 0;
	for (int i = 1; i <= n; i++)
		if (f[i][0]) { pos = i; break; }
	if (!pos) std::cout << "NO\n";
	else {
		std::cout << "YES\n";
		print(pos);
	}
}

